package com.example.idlefish.GoodsInfo.ActivityContract

import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.activity.result.contract.ActivityResultContract
import com.example.idlefish.GoodsInfo.CreateGoodActivity
import com.example.idlefish.GoodsInfo.pojo.Good
import com.example.idlefish.PublicModule.CommonUtil

class CreateGoodActivityContract:ActivityResultContract<Unit, Long?>() {
    override fun createIntent(context: Context, input: Unit): Intent {
        val intent = Intent(context, CreateGoodActivity::class.java)
        return intent
    }
//新汽车可以吗 我想要新车乌拉乌拉乌拉
    override fun parseResult(resultCode: Int, intent: Intent?): Long? {
        if (resultCode != Activity.RESULT_OK || intent == null)
        {
            return null
        }
        val data = intent.getLongExtra("goodId", -1L) //
        return data
    }
}